package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.service.IGoodsTypeService;
import jdk.nashorn.internal.objects.annotations.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Lyu
 */
@RestController
@RequestMapping("/goodstypes")
public class GoodsTypeController {

    private final IGoodsTypeService goodsTypeService;

    @Autowired
    public GoodsTypeController(IGoodsTypeService goodsTypeService) {
        this.goodsTypeService = goodsTypeService;
    }

    /**
     * 查询所有类型
     *
     * @return 商品类型
     */
    @GetMapping
    public Object list() {
        return goodsTypeService.listAll();
    }
}
